package ru.msu.cmc.sp.oberon2;
import java.util.Iterator;
import java.util.LinkedHashMap;

public class HashMapCloner {
	public HashMapCloner() {}
	
	public static LinkedHashMap<String, Symbol> clone(LinkedHashMap<String, Symbol> map) {
		LinkedHashMap<String, Symbol> clone = new LinkedHashMap<String, Symbol>();
		Iterator iterator = map.values().iterator();
		while (iterator.hasNext()) {
			Symbol tmp = ((Symbol)iterator.next()).clone();
			clone.put(tmp.name, tmp);
		}
		return clone;
	}
}
